-
Notifications
You must be signed in to change notification settings - Fork 0
chore(treefmt): replace prettier with oxfmt and simplify CI #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Migrate from prettier to oxfmt for formatting non-Python files. oxfmt is part of the oxc project and provides faster formatting with native Rust implementation. Changes: - Remove prettier configuration from treefmt programs - Add oxfmt as custom formatter with explicit includes - Extend supported file types: md, yml, yaml, json, ts, tsx, js, jsx, html, css - Update flake.lock with latest nixpkgs containing oxfmt
Simplify justfile by combining related operations: - lint: now includes format check (nix fmt --fail-on-change) - format: replaces lint-fix, runs ruff fix and nix fmt together This makes the CI workflow simpler as format checking is now part of the lint command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 3 files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR replaces prettier with oxfmt for formatting non-Python files and consolidates the justfile commands to streamline the development workflow.
- Swaps prettier for oxfmt as the formatter for markdown, YAML, JSON, and additional file types
- Renames
lint-fixcommand toformatand adds format checking to thelintcommand - Updates dependency locks for git-hooks, nixpkgs, and treefmt-nix
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| flake.nix | Removes prettier configuration and adds oxfmt as a custom formatter with expanded file type support (md, yml, yaml, json, ts, tsx, js, jsx, html, css) |
| justfile | Updates lint command to include format checking via nix fmt -- --fail-on-change, and renames lint-fix to format which runs both ruff fix and nix fmt |
| flake.lock | Updates lock hashes and timestamps for git-hooks.nix, nixpkgs, and treefmt-nix dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| typos.enable = true; | ||
| }; | ||
| settings.formatter.oxfmt = { | ||
| command = "${pkgs.oxfmt}/bin/oxfmt"; |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package reference pkgs.oxfmt may not exist in nixpkgs. The oxfmt formatter is part of the oxc project, but it's unclear if it's available as a standalone package named oxfmt in nixpkgs. You should verify that this package exists in the nixpkgs version being used (nixpkgs-unstable). If the package doesn't exist or has a different name, the build will fail. Common alternatives might be pkgs.oxc (if oxfmt is included) or it may need to be added as a separate input or built from source.
| command = "${pkgs.oxfmt}/bin/oxfmt"; | |
| command = "${pkgs.oxc}/bin/oxfmt"; |
treefmt already includes ruff-check and typos, so remove redundant commands from justfile and CI workflow. Changes: - Remove separate `uv run ruff check` from lint (treefmt runs ruff-check) - Remove `typos` and `typos-fix` commands (treefmt runs typos) - Remove typos CI job (covered by lint via treefmt)
glebedel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
What Changed
flake.nix:
justfile:
lint: now just runsnix fmt --fail-on-change(includes ruff-check, typos, nixfmt, oxfmt)format: now just runsnix fmttyposandtypos-fixcommands (already in treefmt)ci.yaml:
typosjob (now covered bylint)Why